Skip to main content

winsafe\ole\co/
consts.rs

1#![allow(non_camel_case_types)]
2
3use crate::macros::*;
4
5const_bitflag! { ADVF: u32;
6	/// [`ADVF`](https://learn.microsoft.com/en-us/windows/win32/api/objidl/ne-objidl-advf)
7	/// enumeration (`u32`).
8	=>
9	NODATA 1
10	PRIMEFIRST 2
11	ONLYONCE 4
12	DATAONSTOP 64
13}
14
15const_bitflag! { BIND: u32;
16	/// [`BIND_FLAGS`](https://learn.microsoft.com/en-us/windows/win32/api/objidl/ne-objidl-bind_flags)
17	/// enumeration (`u32`).
18	=>
19	MAYBOTHERUSER 1
20	JUSTTESTEXISTENCE 2
21}
22
23const_ordinary! { CLSCTX: u32;
24	/// [`CLSCTX`](https://learn.microsoft.com/en-us/windows/win32/api/wtypesbase/ne-wtypesbase-clsctx)
25	/// enumeration (`u32`).
26	=>
27	/// Same process.
28	///
29	/// The code that creates and manages objects of this class is a DLL that
30	/// runs in the same process as the caller of the function specifying the
31	/// class context.
32	INPROC_SERVER 0x1
33	/// The code that manages objects of this class is an in-process handler.
34	/// This is a DLL that runs in the client process and implements client-side
35	/// structures of this class when instances of the class are accessed
36	/// remotely.
37	INPROC_HANDLER 0x2
38	/// Different process, same computer.
39	///
40	/// The EXE code that creates and manages objects of this class runs on same
41	/// machine but is loaded in a separate process space.
42	LOCAL_SERVER 0x4
43	/// Different computer.
44	///
45	/// A remote context. The `LocalServer32` or `LocalService` code that creates
46	/// and manages objects of this class is run on a different computer.
47	REMOTE_SERVER 0x10
48	/// Disables the downloading of code from the directory service or the
49	/// Internet. This flag cannot be set at the same time as
50	/// `CLSCTX::ENABLE_CODE_DOWNLOAD`.
51	NO_CODE_DOWNLOAD 0x400
52	/// Specify if you want the activation to fail if it uses custom marshalling.
53	NO_CUSTOM_MARSHAL 0x1000
54	/// Enables the downloading of code from the directory service or the
55	/// Internet. This flag cannot be set at the same time as
56	/// `CLSCTX::NO_CODE_DOWNLOAD`.
57	ENABLE_CODE_DOWNLOAD 0x2000
58	/// The `CLSCTX::NO_FAILURE_LOG` can be used to override the logging of
59	/// failures in `CoCreateInstanceEx`.
60	NO_FAILURE_LOG 0x4000
61	/// Disables activate-as-activator (AAA) activations for this activation only.
62	DISABLE_AAA 0x8000
63	/// Enables activate-as-activator (AAA) activations for this activation only.
64	ENABLE_AAA 0x1_0000
65	/// Begin this activation from the default context of the current apartment.
66	FROM_DEFAULT_CONTEXT 0x2_0000
67	/// Activate or connect to a 32-bit version of the server; fail if one is not
68	/// registered.
69	ACTIVATE_X86_SERVER 0x4_0000
70	/// Activate or connect to a 32-bit version of the server; fail if one is not
71	/// registered.
72	ACTIVATE_32_BIT_SERVER Self::ACTIVATE_X86_SERVER.0
73	/// Activate or connect to a 64 bit version of the server; fail if one is not
74	/// registered.
75	ACTIVATE_64_BIT_SERVER 0x8_0000
76	/// Specify this flag for Interactive User activation behavior for
77	/// As-Activator servers.
78	ACTIVATE_AAA_AS_IU 0x80_0000
79	/// (No official docs for this entry.)
80	ACTIVATE_ARM32_SERVER 0x200_0000
81
82	ALL Self::INPROC_SERVER.0 | Self::INPROC_HANDLER.0 | Self::LOCAL_SERVER.0 | Self::REMOTE_SERVER.0
83	SERVER Self::INPROC_SERVER.0 | Self::INPROC_HANDLER.0 | Self::LOCAL_SERVER.0
84}
85
86const_bitflag! { COINIT: u32;
87	/// [`COINIT`](https://learn.microsoft.com/en-us/windows/win32/api/objbase/ne-objbase-coinit)
88	/// enumeration (`u32`).
89	=>
90	/// Initializes the thread for apartment-threaded object concurrency.
91	///
92	/// Use this when in a thread that creates a window.
93	APARTMENTTHREADED 0x2
94	/// Initializes the thread for multithreaded object concurrency.
95	///
96	/// Use this when in a thread that doesn't create a window.
97	MULTITHREADED 0x0
98	/// Disables DDE for OLE1 support.
99	///
100	/// It's a good idea to add this flag, since it avoids some overhead
101	/// associated with OLE 1.0, an obsolete technology.
102	DISABLE_OLE1DDE 0x4
103	/// Increase memory usage in an attempt to increase performance.
104	SPEED_OVER_MEMORY 0x8
105}
106
107const_bitflag! { DROPEFFECT: u32;
108	/// [`DROPEFFECT`](https://learn.microsoft.com/en-us/windows/win32/com/dropeffect-constants)
109	/// constants (`u32`).
110	=>
111	NONE 0
112	COPY 1
113	MOVE 2
114	LINK 4
115	SCROLL 0x8000_0000
116}
117
118const_ordinary! { DVASPECT: u32;
119	/// [`DVASPECT`](https://learn.microsoft.com/en-us/windows/win32/api/wtypes/ne-wtypes-dvaspect)
120	/// enumeration (`u32`).
121	=>
122	CONTENT 1
123	THUMBNAIL 2
124	ICON 4
125	DOCPRINT 8
126}
127
128const_ordinary! { FACILITY: u32;
129	/// [`HRESULT`](crate::co::HRESULT) facility (`u32`).
130	=>
131	NULL 0
132	RPC 1
133	DISPATCH 2
134	STORAGE 3
135	ITF 4
136	WIN32 7
137	WINDOWS 8
138	SSPI 9
139	SECURITY 9
140	CONTROL 10
141	CERT 11
142	INTERNET 12
143	MEDIASERVER 13
144	MSMQ 14
145	SETUPAPI 15
146	SCARD 16
147	COMPLUS 17
148	AAF 18
149	URT 19
150	ACS 20
151	DPLAY 21
152	UMI 22
153	SXS 23
154	WINDOWS_CE 24
155	HTTP 25
156	USERMODE_COMMONLOG 26
157	WER 27
158	USERMODE_FILTER_MANAGER 31
159	BACKGROUNDCOPY 32
160	CONFIGURATION 33
161	WIA 33
162	STATE_MANAGEMENT 34
163	METADIRECTORY 35
164	WINDOWSUPDATE 36
165	DIRECTORYSERVICE 37
166	GRAPHICS 38
167	SHELL 39
168	NAP 39
169	TPM_SERVICES 40
170	TPM_SOFTWARE 41
171	UI 42
172	XAML 43
173	ACTION_QUEUE 44
174	PLA 48
175	WINDOWS_SETUP 48
176	FVE 49
177	FWP 50
178	WINRM 51
179	NDIS 52
180	USERMODE_HYPERVISOR 53
181	CMI 54
182	USERMODE_VIRTUALIZATION 55
183	USERMODE_VOLMGR 56
184	BCD 57
185	USERMODE_VHD 58
186	USERMODE_HNS 59
187	SDIAG 60
188	WEBSERVICES 61
189	WINPE 61
190	WPN 62
191	WINDOWS_STORE 63
192	INPUT 64
193	EAP 66
194	WINDOWS_DEFENDER 80
195	OPC 81
196	XPS 82
197	MBN 84
198	POWERSHELL 84
199	RAS 83
200	P2P_INT 98
201	P2P 99
202	DAF 100
203	BLUETOOTH_ATT 101
204	AUDIO 102
205	STATEREPOSITORY 103
206	VISUALCPP 109
207	SCRIPT 112
208	PARSE 113
209	BLB 120
210	BLB_CLI 121
211	WSBAPP 122
212	BLBUI 128
213	USN 129
214	USERMODE_VOLSNAP 130
215	TIERING 131
216	WSB_ONLINE 133
217	ONLINE_ID 134
218	DEVICE_UPDATE_AGENT 135
219	DRVSERVICING 136
220	DLS 153
221	DELIVERY_OPTIMIZATION 208
222	USERMODE_SPACES 231
223	USER_MODE_SECURITY_CORE 232
224	USERMODE_LICENSING 234
225	SOS 160
226	DEBUGGERS 176
227	SPP 256
228	RESTORE 256
229	DMSERVER 256
230	DEPLOYMENT_SERVICES_SERVER 257
231	DEPLOYMENT_SERVICES_IMAGING 258
232	DEPLOYMENT_SERVICES_MANAGEMENT 259
233	DEPLOYMENT_SERVICES_UTIL 260
234	DEPLOYMENT_SERVICES_BINLSVC 261
235	DEPLOYMENT_SERVICES_PXE 263
236	DEPLOYMENT_SERVICES_TFTP 264
237	DEPLOYMENT_SERVICES_TRANSPORT_MANAGEMENT 272
238	DEPLOYMENT_SERVICES_DRIVER_PROVISIONING 278
239	DEPLOYMENT_SERVICES_MULTICAST_SERVER 289
240	DEPLOYMENT_SERVICES_MULTICAST_CLIENT 290
241	DEPLOYMENT_SERVICES_CONTENT_PROVIDER 293
242	LINGUISTIC_SERVICES 305
243	AUDIOSTREAMING 1094
244	ACCELERATOR 1536
245	WMAAECMA 1996
246	DIRECTMUSIC 2168
247	DIRECT3D10 2169
248	DXGI 2170
249	DXGI_DDI 2171
250	DIRECT3D11 2172
251	DIRECT3D11_DEBUG 2173
252	DIRECT3D12 2174
253	DIRECT3D12_DEBUG 2175
254	LEAP 2184
255	AUDCLNT 2185
256	WINCODEC_DWRITE_DWM 2200
257	WINML 2192
258	DIRECT2D 2201
259	DEFRAG 2304
260	USERMODE_SDBUS 2305
261	JSCRIPT 2306
262	PIDGENX 2561
263	EAS 85
264	WEB 885
265	WEB_SOCKET 886
266	MOBILE 1793
267	SQLITE 1967
268	UTC 1989
269	WEP 2049
270	SYNCENGINE 2050
271	XBOX 2339
272	GAME 2340
273	PIX 2748
274}
275
276const_bitflag! { LOCKTYPE: u32;
277	/// [`LOCKTYPE`](https://learn.microsoft.com/en-us/windows/win32/api/objidl/ne-objidl-locktype)
278	/// enumeration (`u32`).
279	=>
280	WRITE 1
281	EXCLUSIVE 2
282	ONLYONCE 4
283}
284
285const_ordinary! { MKRREDUCE: u32;
286	/// [How far](https://learn.microsoft.com/en-us/windows/win32/api/objidl/ne-objidl-mkrreduce)
287	/// a moniker should be reduced (`u32`).
288	=>
289	ONE (3 << 16)
290	TOUSER (2 << 16)
291	THROUGHUSER (1 << 16)
292	ALL 0
293}
294
295const_ordinary! { MKSYS: u32;
296	/// Moniker
297	/// [classes](https://learn.microsoft.com/en-us/windows/win32/api/objidl/ne-objidl-mksys)
298	/// (`u32`).
299	=>
300	NONE 0
301	GENERICCOMPOSITE 1
302	FILEMONIKER 2
303	ANTIMONIKER 3
304	ITEMMONIKER 4
305	POINTERMONIKER 5
306	CLASSMONIKER 7
307	OBJREFMONIKER 8
308	SESSIONMONIKER 9
309	LUAMONIKER 10
310}
311
312const_bitflag! { PICTURE: u32;
313	/// [`PICTUREATTRIBUTES`](https://learn.microsoft.com/en-us/windows/win32/api/ocidl/ne-ocidl-pictureattributes)
314	/// enumeration (`u32`).
315	=>
316	SCALABLE 0x1
317	TRANSPARENT 0x2
318}
319
320const_ordinary! { PICTYPE: i16;
321	/// [`PICTYPE`](https://learn.microsoft.com/en-us/windows/win32/com/pictype-constants)
322	/// constants (`i16`).
323	=>
324	UNINITIALIZED -1
325	NONE 0
326	BITMAP 1
327	METAFILE 2
328	ICON 3
329	ENHMETAFILE 4
330}
331
332const_ordinary! { RPC_C_AUTHN: u32;
333	/// Authentication service
334	/// [constants](https://learn.microsoft.com/en-us/windows/win32/com/com-authentication-service-constants)
335	/// (`u32`).
336	=>
337	NONE 0
338	DCE_PRIVATE 1
339	DCE_PUBLIC 2
340	DEC_PUBLIC 4
341	GSS_NEGOTIATE 9
342	WINNT 10
343	GSS_SCHANNEL 14
344	GSS_KERBEROS 16
345	DPA 17
346	MSN 18
347	DIGEST 21
348	KERNEL 20
349	NEGO_EXTENDER 30
350	PKU2U 31
351	LIVE_SSP 32
352	LIVEXP_SSP 35
353	CLOUD_AP 36
354	MSONLINE 82
355	MQ 100
356	DEFAULT 0xffff_ffff
357}
358
359const_ordinary! { RPC_C_AUTHN_LEVEL: u32;
360	/// Authentication level
361	/// [constants](https://learn.microsoft.com/en-us/windows/win32/com/com-authentication-level-constants)
362	/// (`u32`).
363	=>
364	DEFAULT 0
365	NONE 1
366	CONNECT 2
367	CALL 3
368	PKT 4
369	PKT_INTEGRITY 5
370	PKT_PRIVACY 6
371}
372
373const_ordinary! { RPC_C_AUTHZ: u32;
374	/// Authorization
375	/// [constants](https://learn.microsoft.com/en-us/windows/win32/com/com-authorization-constants)
376	/// (`u32`).
377	=>
378	NONE 0
379	NAME 1
380	DCE 2
381	DEFAULT 0xffff_ffff
382}
383
384const_ordinary! { RPC_C_IMP_LEVEL: u32;
385	/// Impersonation level
386	/// [constants](https://learn.microsoft.com/en-us/windows/win32/com/com-impersonation-level-constants)
387	/// (`u32`).
388	=>
389	DEFAULT 0
390	ANONYMOUS 1
391	IDENTIFY 2
392	IMPERSONATE 3
393	DELEGATE 4
394}
395
396const_ordinary! { RPC_C_QOS_CAPABILITIES: u32;
397	/// [Quality of service](https://learn.microsoft.com/en-us/windows/win32/rpc/quality-of-service)
398	/// capabilities (`u32`).
399	=>
400	DEFAULT 0x0
401	MUTUAL_AUTH 0x1
402	MAKE_FULLSIC 0x2
403	ANY_AUTHORITY 0x4
404	IGNORE_DELEGATE_FAILURE 0x8
405	LOCAL_MA_HINT 0x10
406	SCHANNEL_FULL_AUTH_IDENTITY 0x20
407}
408
409const_ordinary! { SEC_WINNT_AUTH_IDENTITY: u32;
410	/// [`COAUTHIDENTITY`](crate::COAUTHIDENTITY) `Flags` (`u32`).
411	=>
412	ANSI 0x1
413	UNICODE 0x2
414}
415
416const_ordinary! { SEVERITY: u8;
417	/// [`HRESULT`](crate::co::HRESULT) severity (`u8`).
418	=>
419	SUCCESS 0
420	FAILURE 1
421}
422
423const_bitflag! { SLR: u32;
424	/// [`BIND_OPTS3`](crate::BIND_OPTS3) and
425	/// [`IShellLink::Resolve`](crate::prelude::shell_IShellLink::GetPath)
426	/// `flags` (`u32`).
427	=>
428	NONE 0
429	NO_UI 0x1
430	ANY_MATCH 0x2
431	UPDATE 0x4
432	NOUPDATE 0x8
433	NOSEARCH 0x10
434	NOTRACK 0x20
435	NOLINKINFO 0x40
436	INVOKE_MSI 0x80
437	NO_UI_WITH_MSG_PUMP 0x101
438	OFFER_DELETE_WITHOUT_FILE 0x200
439	KNOWNFOLDER 0x400
440	MACHINE_IN_LOCAL_TARGET 0x800
441	UPDATE_MACHINE_AND_SID 0x1000
442	NO_OBJECT_ID 0x2000
443}
444
445const_bitflag! { STGC: u32;
446	/// [`STGC`](https://learn.microsoft.com/en-us/windows/win32/api/wtypes/ne-wtypes-stgc)
447	/// enumeration (`u32`).
448	=>
449	DEFAULT 0
450	OVERWRITE 1
451	ONLYIFCURRENT 2
452	DANGEROUSLYCOMMITMERELYTODISKCACHE 4
453	CONSOLIDATE 8
454}
455
456const_bitflag! { STGM: u32;
457	/// [`STGM`](https://learn.microsoft.com/en-us/windows/win32/stg/stgm-constants)
458	/// enumeration (`u32`).
459	=>
460	READ 0x0000_0000
461	WRITE 0x0000_0001
462	READWRITE 0x0000_0002
463	SHARE_DENY_NONE 0x0000_0040
464	SHARE_DENY_READ 0x0000_0030
465	SHARE_DENY_WRITE 0x0000_0020
466	SHARE_EXCLUSIVE 0x0000_0010
467	PRIORITY 0x0004_0000
468	CREATE 0x0000_1000
469	CONVERT 0x0002_0000
470	FAILIFTHERE 0x0000_0000
471	DIRECT 0x0000_0000
472	TRANSACTED 0x0001_0000
473	NOSCRATCH 0x0010_0000
474	NOSNAPSHOT 0x0020_0000
475	SIMPLE 0x0800_0000
476	DIRECT_SWMR 0x0040_0000
477	DELETEONRELEASE 0x0400_0000
478}
479
480const_ordinary! { STGMOVE: u32;
481	/// [`STGMOVE`](https://learn.microsoft.com/en-us/windows/win32/api/wtypes/ne-wtypes-stgmove)
482	/// enumeration (`u32`).
483	=>
484	MOVE 0
485	COPY 1
486	SHALLOWCOPY 2
487}
488
489const_ordinary! { STREAM_SEEK: u32;
490	/// [`STREAM_SEEK`](https://learn.microsoft.com/en-us/windows/win32/api/objidl/ne-objidl-stream_seek)
491	/// enumeration (`u32`).
492	=>
493	SET 0
494	CUR 1
495	END 2
496}
497
498const_ordinary! { TYMED: u32;
499	/// [`TYMED`](https://learn.microsoft.com/en-us/windows/win32/api/objidl/ne-objidl-tymed)
500	/// enumeration (`u32`).
501	=>
502	HGLOBAL 1
503	FILE 2
504	ISTREAM 4
505	ISTORAGE 8
506	GDI 16
507	MFPICT 32
508	ENHMF 64
509	NULL 0
510}